home *** CD-ROM | disk | FTP | other *** search
/ Motor Sport Digital Archive Collection 1960s / Motor Sport Digital Archive Collection 1960s.iso / main.swf / scripts / mx / messaging / messages / CommandMessage.as < prev    next >
Encoding:
Text File  |  2008-05-21  |  2.6 KB  |  77 lines

  1. package mx.messaging.messages
  2. {
  3.    public class CommandMessage extends AsyncMessage
  4.    {
  5.       public static const SUBSCRIBE_OPERATION:uint = 0;
  6.       
  7.       public static const UNSUBSCRIBE_OPERATION:uint = 1;
  8.       
  9.       public static const POLL_OPERATION:uint = 2;
  10.       
  11.       public static const CLIENT_SYNC_OPERATION:uint = 4;
  12.       
  13.       public static const CLIENT_PING_OPERATION:uint = 5;
  14.       
  15.       public static const CLUSTER_REQUEST_OPERATION:uint = 7;
  16.       
  17.       public static const LOGIN_OPERATION:uint = 8;
  18.       
  19.       public static const LOGOUT_OPERATION:uint = 9;
  20.       
  21.       public static const SESSION_INVALIDATE_OPERATION:uint = 10;
  22.       
  23.       public static const UNKNOWN_OPERATION:uint = 10000;
  24.       
  25.       public static const AUTHENTICATION_MESSAGE_REF_TYPE:String = "flex.messaging.messages.AuthenticationMessage";
  26.       
  27.       public static const SELECTOR_HEADER:String = "DSSelector";
  28.       
  29.       private static var operationTexts:Object = null;
  30.       
  31.       public var operation:uint;
  32.       
  33.       public var messageRefType:String;
  34.       
  35.       public function CommandMessage()
  36.       {
  37.          super();
  38.          operation = UNKNOWN_OPERATION;
  39.          messageRefType = null;
  40.       }
  41.       
  42.       public static function getOperationAsString(param1:uint) : String
  43.       {
  44.          var _loc2_:* = undefined;
  45.          if(operationTexts == null)
  46.          {
  47.             operationTexts = {};
  48.             operationTexts[SUBSCRIBE_OPERATION] = "subscribe";
  49.             operationTexts[UNSUBSCRIBE_OPERATION] = "unsubscribe";
  50.             operationTexts[POLL_OPERATION] = "poll";
  51.             operationTexts[CLIENT_SYNC_OPERATION] = "client sync";
  52.             operationTexts[CLIENT_PING_OPERATION] = "client ping";
  53.             operationTexts[CLUSTER_REQUEST_OPERATION] = "cluster request";
  54.             operationTexts[LOGIN_OPERATION] = "login";
  55.             operationTexts[LOGOUT_OPERATION] = "logout";
  56.             operationTexts[SESSION_INVALIDATE_OPERATION] = "session invalidate";
  57.             operationTexts[UNKNOWN_OPERATION] = "unknown";
  58.          }
  59.          _loc2_ = operationTexts[param1];
  60.          return _loc2_ == undefined ? param1.toString() : String(_loc2_);
  61.       }
  62.       
  63.       override public function toString() : String
  64.       {
  65.          return getDebugString();
  66.       }
  67.       
  68.       override protected function addDebugAttributes(param1:Object) : void
  69.       {
  70.          super.addDebugAttributes(param1);
  71.          param1["operation"] = getOperationAsString(operation);
  72.          param1["messageRefType"] = messageRefType;
  73.       }
  74.    }
  75. }
  76.  
  77.